home *** CD-ROM | disk | FTP | other *** search
/ Aminet 51 / Aminet 51 (2002)(GTI - Schatztruhe)[!][Oct 2002].iso / Aminet / dev / gcc / x86-ami-gcc.readme < prev   
Encoding:
Text File  |  2002-07-25  |  5.1 KB  |  187 lines

  1. Short:    GCC v2.95.3 - Amithlon x86 cross compiler (68k hosted)
  2. Author:   Jens.Langner@light-speed.de (Jens Langner)
  3. Uploader: Jens.Langner@light-speed.de (Jens Langner)
  4. Version:  2.95.3
  5. Type:     dev/gcc
  6. Requires: dev/gcc/x86-ami-bin.lha
  7.  
  8. About
  9. -----
  10. This archive contains a uptodate version of a AmigaOS (68k)
  11. hosted gcc cross compiler environment for compiling/porting
  12. existing applications to Amithlon (x86).
  13.  
  14. By installing this cross compiler, one will be able to
  15. easily port existing AmigaOS application to the new x86 hosted
  16. Amithlon emulation (www.amithlon.net)
  17.  
  18. This version is based on the 2.95.3 version of the gcc compiler
  19. with changed mainly made by Martin Blom <martin@blom.org>.
  20. http://www.lysator.liu.se/~lcs/files/gg-cross
  21.  
  22. Please note that you also need the x86-ami-bin.lha archive to
  23. successfully use the cross-compiler.
  24.  
  25. Jens Langner <Jens.Langner@light-speed.de>
  26. July 2002
  27.  
  28. Documentation
  29. -------------
  30.  
  31. Setting up a i686be-amithlon cross compiler under AmigaOS
  32. ---------------------------------------------------------
  33.  
  34. 1) If you don't have a GeekGadget environment:
  35.  
  36. Make a GeekGadget directory somewhere, and assign GG: to it.
  37.  
  38.    1> makedir some_volume:GeekGadgets
  39.    1> assign GG: some_volume:GeekGadgets
  40.  
  41. Make a GG:bin directory, and add it to your path, or add it to
  42. your c: assign.
  43.  
  44.    1> makedir GG:bin
  45.    1> path GG:bin add
  46.  
  47.  
  48. 2) Unarchive the "x86-ami-bin.lha" and "x86-ami-gcc.lha" in GG:
  49.  
  50.    1> cd GG:
  51.    1> lha x  some_dir/x86-ami-bin.lha
  52.    1> lha x  some_dir/x86-ami-gcc.lha
  53.  
  54.  Warning 1:
  55.  ----------
  56. If you are unarchiving on a filesystem that doesn't support
  57. hard-links (e.g. SFS), you will have error messages and will
  58. need to make the links by hand (or replace them with copies).
  59. You need to have:
  60.   gg:i686be-amithlon/bin/as     ->  gg:bin/i686be-amithlon-as
  61.   gg:i686be-amithlon/bin/ar     ->  gg:bin/i686be-amithlon-ar
  62.   gg:i686be-amithlon/bin/ld     ->  gg:bin/i686be-amithlon-ld
  63.   gg:i686be-amithlon/bin/nm     ->  gg:bin/i686be-amithlon-nm
  64.   gg:i686be-amithlon/bin/ranlib ->  gg:bin/i686be-amithlon-ranlib
  65.   gg:i686be-amithlon/bin/strip  ->  gg:bin/i686be-amithlon-strip
  66.  
  67. where "->" means "link to" or "copy of".
  68.  
  69.  Warning 2:
  70.  ----------
  71. If using soft links, you have to specify the full path of the
  72. destination, not just a relative one.
  73.  
  74.  Warning 3:
  75.  ----------
  76. If using soft links under SFS, you need at least SFS version 1.62.
  77.  
  78.  
  79. 3) Copy the contents of the amithlon gcc includes to
  80.    GG:i686be-amithlon/sys-include
  81.  
  82.     1> copy somepath/includeamithlon GG:i686be-amithlon/sys-include all
  83.  
  84.  
  85. 4) Copy the lib directory from the amithlon lib archive to
  86.    GG:i686be-amithlon/lib and GG:i686be-amithlon/lib/libnix
  87.  
  88.     1> copy somepath/lib/libamigastubs.a GG:i686be-amithlon/lib
  89.  
  90.     1> copy somepath/lib/libnix GG:i686be-amithlon/lib ALL
  91.  
  92.   you can get those files from
  93.   http://www.lysator.liu.se/~lcs/files/gg-cross
  94.  
  95.  
  96.     Usage
  97.     -----
  98.  
  99. Currently, as there is no ixemul part for this amithlon gcc compiler,
  100. you always have to specify -noixemul for compiling something.
  101.  
  102. To compile 'hello.c' to 'hello' using libnix:
  103.  
  104.    1> i686be-amithlon-gcc -noixemul -o hello hello.c
  105.  
  106. To strip debugging informations and symbols from an executable file:
  107.  
  108.    1> i686be-amithlon-strip hello
  109.  
  110. To compile and link separately:
  111.  
  112.    1> i686be-amithlon-gcc -noixemul -c hello1.c
  113.    1> i686be-amithlon-gcc -noixemul -c hello2.c
  114.    1> i686be-amithlon-gcc -noixemul -r -o hello hello1.o hello2.o
  115.  
  116. (the last step can be replaced by a direct call to i686be-amithlon-ld)
  117.  
  118. Please note that your have to use the "-r" option for the moment like
  119. in former PowerUP days, as the linker isn`t fully working yet without
  120. it.
  121.  
  122. * Some useful options:
  123.  
  124.    -O, -O2, -O3 to optimize (-O3 make files bigger, be careful)
  125.  
  126.    -mcpu=i386, -mcpu=i486, -mcpu=pentium, -mcpu=k6 to optimize for a
  127.    specific cpu. Files optimized for one processor still work on others.
  128.  
  129.    -v to view the exact commands executed by gcc, and its include
  130. search path. Useful to find out installation problems.
  131.  
  132.  
  133. * Predefined symbols:
  134.  
  135. __ELF__, __pentiumpro__, __amithlon__
  136.  
  137. __i386__ if compiled with -mcpu=i386
  138. __i486__ if compiled with -mcpu=i486
  139. __i586__ if compiled with -mcpu=i586 or -mcpu=k6
  140. __i686__ if compiled without -mcpu= or -mcpu=pentiumpro
  141.  
  142. __amigaos__, amigaos, amiga, AMIGA, MCH_AMIGA for compatibility
  143.  
  144.  
  145. * Some remarks:
  146.  
  147. 1) This compiler uses the natural alignment, i.e. in
  148.    struct S
  149.    {
  150.      short a;
  151.      long b;
  152.    };
  153.  
  154. the offset of 'b' is 4, and not 2 as with 68k compilers. You can
  155. force the alignment to be 2 by defining S as follow:
  156.  
  157.   struct S
  158.   {
  159.     short a;
  160.     long b __attribute__((aligned(2)));
  161.   } __attribute__((packed));
  162.  
  163. or even better by:
  164.  
  165.   #pragma pack(2)
  166.    struct S
  167.    {
  168.      short a;
  169.      long b;
  170.    };
  171.   #pragma pack()
  172.  
  173. Usually you shouldn't care about that, except in interfaces with
  174. external libraries, or for binary compatibility if you read/write
  175. such structures from/to files.
  176.  
  177. Attn: floats and doubles must _never_ have an alignment lower than 4.
  178.  
  179. 2) The diff file on which this release was build can be found at:
  180.    http://www.lysator.liu.se/~lcs/files/gg-cross
  181.  
  182. Have phun
  183. and keep up the good work
  184.  
  185. Jens Langner <Jens.Langner@light-speed.de>
  186. July 2002
  187.